<?php
/**
 * +----------------------------------------------------------------------
 * | Copyright © Sogu Technologies Co. Ltd 2018-2050 All rights reserved.
 * +----------------------------------------------------------------------
 * | File name: CommonPlatformRequest.php
 * +----------------------------------------------------------------------
 * | Author:
 * +----------------------------------------------------------------------
 * | Description: 催收请求类
 * +----------------------------------------------------------------------
 * | Others: 其他内容的说明
 * +----------------------------------------------------------------------
 * | History: 修改历史记录列表，每条修改记录应包含修改日期、修改者及修改内容简述
 * +----------------------------------------------------------------------
 * | 1.Date: 2018/12/25 Author: sam Modification: 创建
 * +----------------------------------------------------------------------
 */

namespace App\Library\Guzzle;

use App\Library\Traits\RepayBuckle;

class RepayBuckleRequest
{
    use RepayBuckle;
    /**
     * 裸扣平台基础uri
     * @var \Illuminate\Config\Repository|mixed
     */
    protected $base_buckle_uri;

    /**
     *
     * @var string
     */
    protected $set_buckle_money = '/api/jd/pay/1.0/withhold';

    /**
     *获取结果
     * @var string
     */
    protected $get_buckle_money_result = '/api/jd/pay/1.0/queryOrder';

    /**
     * CommonPlatformRequest constructor.
     */
    public function __construct()
    {
        $this->base_buckle_uri = config('common.buckle_url');;
    }

    /**
     * Description:请求扣款
     * Author:lijiafei
     * @param array $data
     * @return mixed
     */
    public function setBuckleMoney(array $data)
    {
        $url = $this->set_buckle_money;
        return $this->request($url,$data);
    }

    /**
     * Description:获取结果
     * Author:lijiafei
     * @param array $data
     * @return mixed
     */
    public function getBuckleMoneyResult(array $data)
    {
        $url = $this->get_buckle_money_result;
        return $this->request($url,$data);
    }
}